package com.ay277.htqoa.quartz.entity;


import org.quartz.JobDetail;
import org.quartz.Scheduler;
import org.quartz.SchedulerFactory;
import org.quartz.SimpleTrigger;
import org.quartz.impl.JobDetailImpl;
import org.quartz.impl.StdSchedulerFactory;
import org.quartz.impl.triggers.SimpleTriggerImpl;

import java.util.Date;

/**
 * Created by Temptation on 2016/12/22.
 */
public class Test {
    public static void main(String[] args) throws Exception {
        JobDetailImpl jd=new JobDetailImpl();
        jd.setName("Myjob3");
        jd.setJobClass(MyJob3.class);

        SimpleTriggerImpl st=new SimpleTriggerImpl();
        st.setName("Myjob3");
        st.setRepeatCount(2);
        st.setRepeatInterval(60000);
        st.setJobName("Myjob3");
        st.setStartTime(new Date());

        SchedulerFactory sf=new StdSchedulerFactory();
        Scheduler s=sf.getScheduler();
        s.scheduleJob(jd,st);
        s.start();
        System.in.read();
        s.shutdown();
    }
}
